fix(eks_standard): break terraform locals cycle in cluster addons#348
Merged
Conversation
needs_cloudwatch_iam_policy was derived from enabled_cluster_addons, which depends on default_addons, which references aws_iam_role.cloudwatch_agent_irsa[0].arn. That role's count then referenced needs_cloudwatch_iam_policy, closing the cycle. Source needs_cloudwatch_iam_policy directly from container_insights_enabled (spec input), which already gates inclusion of the cloudwatch addon.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
terraform validatefailed withCycle: aws_iam_role.cloudwatch_agent_irsa → local.needs_cloudwatch_iam_policy → local.enabled_cluster_addons → local.cluster_addons_config → local.default_addons → aws_iam_role.cloudwatch_agent_irsa.local.default_addonsreferencesaws_iam_role.cloudwatch_agent_irsa[0].arn, while the role'scountdepended onneeds_cloudwatch_iam_policy, which was derived fromenabled_cluster_addons(built fromdefault_addons).needs_cloudwatch_iam_policydirectly fromlocal.container_insights_enabled(spec input). That flag already gates inclusion of theamazon-cloudwatch-observabilityaddon indefault_addons, so semantics are unchanged.Test plan
raptor create iac-module -f . --dry-run— terraform validate passes (security scan failures are pre-existing and out of scope)container_insights_enabled = true